package com.link2room.optimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.*;

/**
 * 集团价格计划
 * Created by sss on 2016/8/25.
 */
@MappedSuperclass
@DynamicInsert
public class BaseRateplan extends BaseEntity{
    public enum L2RRateplan_{
        resType,pmsRatecode
    }
    /**
     * 支付类型
     */
    private String resType;

    /**
     * PMS房价码
     */
    private String pmsRatecode;

    @Basic
    @Column(name = "res_type", nullable = false, length = 16)
    public String getResType() {
        return resType;
    }

    public void setResType(String resType) {
        this.resType = resType;
    }

    @Basic
    @Column(name = "pms_ratecode", nullable = false, length = 16)
    public String getPmsRatecode() {
        return pmsRatecode;
    }

    public void setPmsRatecode(String pmsRatecode) {
        this.pmsRatecode = pmsRatecode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BaseRateplan that = (BaseRateplan) o;

        if (resType != null ? !resType.equals(that.resType) : that.resType != null) return false;
        return pmsRatecode != null ? pmsRatecode.equals(that.pmsRatecode) : that.pmsRatecode == null;

    }

    @Override
    public int hashCode() {
        int result = resType != null ? resType.hashCode() : 0;
        result = 31 * result + (pmsRatecode != null ? pmsRatecode.hashCode() : 0);
        return result;
    }
}
